<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">
<h:body>
	<ui:composition template="/view/protected/templates/master.xhtml">

		<ui:define name="divMain">
			<h:form id="edictsForm">
				<p:dataTable id="edictsTable" value="#{edictMB.allEdicts}" 
					var="edict" emptyMessage="#{bundle.noRecords}" paginator="true"
					rows="10"
					paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
					rowsPerPageTemplate="5,10,15">

					<p:column>
						<f:facet name="header">
							<h:outputText value="#{bundle.edict_name}" />
						</f:facet>

						<h:outputText value="#{edict.name}" />
					</p:column>

					<p:column>
						<f:facet name="header">
							<h:outputText value="#{bundle.edict_name_product}" />
						</f:facet>

						<h:outputText value="#{edict.idProduct.name}" />
					</p:column>

					
					<p:column>
						<f:facet name="header">
							<h:outputText value="#{bundle.edict_dateTimeStart}" />
						</f:facet>

						<h:outputText value="#{edict.dateTimeStart}" />
					</p:column>

					<p:column>
						<f:facet name="header">
							<h:outputText value="#{bundle.edict_dateTimeFinish}" />
						</f:facet>

						<h:outputText value="#{edict.dateTimeFinish}" />
					</p:column>
					
					<p:column>
						<p:commandButton value="#{bundle.detail}" icon="ui-icon-bullet"
							onclick="edictDetailDialogWidget.show();"
							update=":edictDetailDialogForm">
							<f:setPropertyActionListener target="#{edictMB.edict}"
								value="#{edict}" />
						</p:commandButton>
						<p:spacer width="10px" />
						<p:commandButton value="#{bundle.button_update}"
							icon="ui-icon-pencil" update=":edictUpdateDialogForm"
							onclick="edictUpdateDialogWidget.show();">
							<f:setPropertyActionListener target="#{edictMB.edict}"
								value="#{edict}" />
						</p:commandButton>
						<p:spacer width="10px" />
						<p:commandButton value="#{bundle.button_delete}"
							icon="ui-icon-trash" update=":edictDeleteDialogForm"
							onclick="edictDeleteDialogWidget.show();">
							<f:setPropertyActionListener target="#{edictMB.edict}"
								value="#{edict}" />
						</p:commandButton>
					</p:column>

				</p:dataTable>
				<p:commandButton value="#{bundle.button_inserir} #{bundle.edict}"
					icon="ui-icon-plus" update=":edictCreateDialogForm"
					actionListener="#{edictMB.resetEdict()}"
					onclick="edictCreateDialogWidget.show();" />
			</h:form>
			
			<ui:include src="/view/protected/admin/edict/edictCreate.xhtml" />
			<ui:include src="/view/protected/admin/edict/edictDetail.xhtml" />
			<ui:include src="/view/protected/admin/edict/edictUpdate.xhtml" />
			<ui:include src="/view/protected/admin/edict/edictDelete.xhtml" />
		</ui:define>
	</ui:composition>
</h:body>
</html>